home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
_ter12b.zip
/
TER12B._XE
/
PASCAL.EXE
/
MANUAL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-06-10
|
4KB
|
132 lines
Program MANUAL; { Converts Terminate help files into the manual }
Type
BufType = Array[1..40960] of Byte;
Var
IB, OB : ^BufType;
InFile,OutFile : Text;
S : String;
TotalLines : Longint;
Function NumChar(Ch : Char; Lgd : Byte): String;
{ Returns a string filled with a char at Lgd Lenght }
Var
s : String;
Begin
FillChar(S[1], Lgd, Ch);
S[0] := Char(Lgd);
NumChar:=S;
End;
Function BlankAfter(Txt : String; Lgd : Byte): String;
{ Appends blank to a string until desired length }
Begin
While Length(Txt)<Lgd Do Txt:=Txt+' ';
BlankAfter:=Txt;
End;
Function SizeOfFile(Filename:string):Longint;
Var
F : File;
Begin
Assign(F,Filename);
{$I-} Reset(F,1); {$I+}
If IOResult=0 Then
Begin
SizeofFile:=FileSize(F);
Close(F);
End
Else SizeofFile:=-1;
End;
Procedure AppendManual(Filename:string; Header:String);
Var Lines:Longint;
Begin
Assign(InFile,Filename);
SetTextBuf(InFile,IB^);
{$I-} Reset(InFile); {$I+}
If IOResult=0 Then
Begin
Lines:=0;
If Header<>'' Then
Begin
{ WriteLn(OutFile,''); } { Page Feed #12 before each helpfile }
WriteLn(OutFile,'┌───────────────────────────────────────────────────────────────────────────┐');
WriteLn(OutFile,'│ ░░░░ '+Header+' '+Numchar('░',67-Length(Header))+' │');
WriteLn(OutFile,'└───────────────────────────────────────────────────────────────────────────┘');
End;
While Not Eof(InFile) Do
Begin
ReadLn(InFile,s);
Inc(Lines);
{ removes any color codes }
While Pos('^b',s)<>0 Do Delete(s,Pos('^b',s),2);
While Pos('^n',s)<>0 Do Delete(s,Pos('^n',s),2);
While Pos('^h',s)<>0 Do Delete(s,Pos('^h',s),2);
While Pos('^t',s)<>0 Do Delete(s,Pos('^t',s),2);
While Pos('^m',s)<>0 Do Delete(s,Pos('^m',s),2);
While Pos('^r',s)<>0 Do Delete(s,Pos('^r',s),2);
While Pos('^f',s)<>0 Do Delete(s,Pos('^f',s),2);
WriteLn(OutFile,s);
End;
Close(InFile);
WriteLn('Compiled : '+BlankAfter(Filename,13)+BlankAfter(Header,42),
Lines:4,' ',SizeofFile(Filename):6);
Inc(TotalLines,Lines);
End
Else WriteLn('Compiling : Error opening '+Filename);
End;
Begin
WriteLn(#10#13'─────────── Terminate manual file compiler made 1993 by Bo Bendtsen ───────────');
New(IB); { Makes large buffers at 40960 bytes each to speed up compile }
New(OB); { time for both input and output files. }
Assign(OutFile,'TERMINAT.DOC');
SetTextBuf(OutFile,OB^);
{$I-} Rewrite(OutFile); {$I+}
If IOResult=0 Then
Begin
TotalLines:=0;
{ Main help file Ctrl-Shift-F1 }
AppendManual('TERMINAT.HLP','');
{ Help files for configuration }
AppendManual('MAINCONF.HLP','Configurating Terminate');
AppendManual('SCRCOLOR.HLP','Screen and Colors');
AppendManual('COMMUNIC.HLP','Communications');
AppendManual('GENERALM.HLP','General options');
AppendManual('TOGGLESM.HLP','Toggles');
AppendManual('MODEMDIA.HLP','Modem and dialing');
AppendManual('FILEPATH.HLP','Filenames and paths');
AppendManual('PROTOCOL.HLP','Protocols');
AppendManual('EMULATIO.HLP','Emulations');
AppendManual('HOSTSETT.HLP','Host mode');
AppendManual('LOGINSCR.HLP','Auto login');
AppendManual('USERSSET.HLP','Users / IEMSI setup');
AppendManual('POINTSYS.HLP','The Pointsystem');
AppendManual('COSTMANA.HLP','Cost management');
{ Help files for other functions }
AppendManual('PHONEBOO.HLP','The Phonebook');
AppendManual('FILETAGG.HLP','File tagging and tagmenu');
AppendManual('FILEMANA.HLP','The Filemanager');
AppendManual('CDROMPLA.HLP','CD audio player');
AppendManual('ENDOFMAN.HLP','End of manual');
Close(OutFile);
WriteLn(Numchar('─',79));
WriteLn('TERMINAT.DOC was compiled Lines / bytes ',
TotalLines:5,' ',SizeofFile('TERMINAT.DOC'):6);
End
Else WriteLn('Could not write to TERMINAT.DOC');
Dispose(IB);
Dispose(OB);
End.